<?php
namespace Plugin\Organization\Schema;

use Plugin\Organization\Model\RdOrganizeEnterprise;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 公司表
 */
#[Schema(title: 'RdOrganizeEnterpriseSchema')]
class RdOrganizeEnterpriseSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: '主键', type: 'bigint')]
    public string $id;

    #[Property(property: 'name', title: '公司名称', type: 'varchar')]
    public string $name;

    #[Property(property: 'icon', title: '图标', type: 'varchar')]
    public string $icon;

    #[Property(property: 'created_by', title: '创建者', type: 'bigint')]
    public string $created_by;

    #[Property(property: 'updated_by', title: '更新者', type: 'bigint')]
    public string $updated_by;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;

    #[Property(property: 'remark', title: '备注', type: 'varchar')]
    public string $remark;




    public function __construct(RdOrganizeEnterprise $model)
    {
       $this->id = $model->id;
       $this->name = $model->name;
       $this->icon = $model->icon;
       $this->created_by = $model->created_by;
       $this->updated_by = $model->updated_by;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->remark = $model->remark;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'name' => $this->name ,'icon' => $this->icon ,'created_by' => $this->created_by ,'updated_by' => $this->updated_by ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'remark' => $this->remark];
    }
}